{"ast":null,"code":"import _slicedToArray from \"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";\nimport _defineProperty from \"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/defineProperty.js\";\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport useStyle from './style';\nimport { isPresetColor } from './utils';\nvar Ribbon = function Ribbon(_ref) {\n  var _classNames;\n  var className = _ref.className,\n    customizePrefixCls = _ref.prefixCls,\n    style = _ref.style,\n    color = _ref.color,\n    children = _ref.children,\n    text = _ref.text,\n    _ref$placement = _ref.placement,\n    placement = _ref$placement === void 0 ? 'end' : _ref$placement;\n  var _React$useContext = React.useContext(ConfigContext),\n    getPrefixCls = _React$useContext.getPrefixCls,\n    direction = _React$useContext.direction;\n  var prefixCls = getPrefixCls('ribbon', customizePrefixCls);\n  var colorInPreset = isPresetColor(color);\n  var ribbonCls = classNames(prefixCls, \"\".concat(prefixCls, \"-placement-\").concat(placement), (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), _defineProperty(_classNames, \"\".concat(prefixCls, \"-color-\").concat(color), colorInPreset), _classNames), className);\n  var _useStyle = useStyle(prefixCls),\n    _useStyle2 = _slicedToArray(_useStyle, 2),\n    wrapSSR = _useStyle2[0],\n    hashId = _useStyle2[1];\n  var colorStyle = {};\n  var cornerColorStyle = {};\n  if (color && !colorInPreset) {\n    colorStyle.background = color;\n    cornerColorStyle.color = color;\n  }\n  return wrapSSR( /*#__PURE__*/React.createElement(\"div\", {\n    className: classNames(\"\".concat(prefixCls, \"-wrapper\"), hashId)\n  }, children, /*#__PURE__*/React.createElement(\"div\", {\n    className: classNames(ribbonCls, hashId),\n    style: Object.assign(Object.assign({}, colorStyle), style)\n  }, /*#__PURE__*/React.createElement(\"span\", {\n    className: \"\".concat(prefixCls, \"-text\")\n  }, text), /*#__PURE__*/React.createElement(\"div\", {\n    className: \"\".concat(prefixCls, \"-corner\"),\n    style: cornerColorStyle\n  }))));\n};\nexport default Ribbon;","map":{"version":3,"names":["classNames","React","ConfigContext","useStyle","isPresetColor","Ribbon","_ref","className","customizePrefixCls","prefixCls","style","color","children","text","placement","useContext","getPrefixCls","direction","colorInPreset","ribbonCls","wrapSSR","hashId","colorStyle","cornerColorStyle","background","createElement","Object","assign"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/antd/es/badge/Ribbon.js"],"sourcesContent":["import classNames from 'classnames';\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport useStyle from './style';\nimport { isPresetColor } from './utils';\nconst Ribbon = function Ribbon(_ref) {\n  let {\n    className,\n    prefixCls: customizePrefixCls,\n    style,\n    color,\n    children,\n    text,\n    placement = 'end'\n  } = _ref;\n  const {\n    getPrefixCls,\n    direction\n  } = React.useContext(ConfigContext);\n  const prefixCls = getPrefixCls('ribbon', customizePrefixCls);\n  const colorInPreset = isPresetColor(color);\n  const ribbonCls = classNames(prefixCls, `${prefixCls}-placement-${placement}`, {\n    [`${prefixCls}-rtl`]: direction === 'rtl',\n    [`${prefixCls}-color-${color}`]: colorInPreset\n  }, className);\n  const [wrapSSR, hashId] = useStyle(prefixCls);\n  const colorStyle = {};\n  const cornerColorStyle = {};\n  if (color && !colorInPreset) {\n    colorStyle.background = color;\n    cornerColorStyle.color = color;\n  }\n  return wrapSSR( /*#__PURE__*/React.createElement(\"div\", {\n    className: classNames(`${prefixCls}-wrapper`, hashId)\n  }, children, /*#__PURE__*/React.createElement(\"div\", {\n    className: classNames(ribbonCls, hashId),\n    style: Object.assign(Object.assign({}, colorStyle), style)\n  }, /*#__PURE__*/React.createElement(\"span\", {\n    className: `${prefixCls}-text`\n  }, text), /*#__PURE__*/React.createElement(\"div\", {\n    className: `${prefixCls}-corner`,\n    style: cornerColorStyle\n  }))));\n};\nexport default Ribbon;"],"mappings":";;AAAA,OAAOA,UAAU,MAAM,YAAY;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